<%@ page contentType="text/html;charset=UTF-8" language="java" trimDirectiveWhitespaces="true" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta name="format-detection" content="email=no">
    <title>荩美国际商城</title>
    <link rel="stylesheet" type="text/css" href="/resources/frontcss/Hui.css" />
    <link rel="stylesheet" type="text/css" href="/resources/frontcss/mui.picker.css" />
    <script src="/resources/js/jquery-1.8.1.min.js" type="text/javascript"></script>
    <script src="/resources/frontcss/mui.min.js" type="text/javascript"></script>
    <style>
        .top-cot{ width:100%; height:2.2rem; line-height:2.2rem; background:#28163d; color:#fff; text-align:center; font-size:16px;}
        .user-allinfo {
            padding: 2px 2px 2px 2px;
            position: relative;
            overflow: visible;
            text-align: center;
        }
        .img-container {
            width: 85px;
            height: 85px;
            position: relative;
            margin: 0 auto;
            font-size: 0;
            overflow: visible;
            border-radius: 50%;
            -webkit-border-radius: 50%;
            margin-bottom: 10px;
        }

        .img-container p {
            position: absolute;
            z-index: 100;
            width: 24px;
            height: 24px;
            text-align: center;
            border-radius: 50%;
            -webkit-border-radius: 50%;
            border: 2px solid #5b95f7;
            background: rgba(255, 255, 255, 0.8);
        }

        .img-container p span {
            color: #ff356a;
            font-size: 14px;
            padding: 0 !important;
        }

        .img-container p.ico-xji {
            left: 0;
            top: 0;
        }
        .img-container p.ico-gender {
            right: 0;
            bottom: 0;
        }
        .user-allinfo img {
            width: 85px;
            height: 85px;
            border-radius: 50%;
            -webkit-border-radius: 50%;
            margin: 0 auto 0 auto;
        }
    </style>
</head>
<body>
<div class="top-cot">会员信息</div>
<div class="user-allinfo">
    <div class="img-container" id="headIcon">
        <img id="userhead" src="${user.headimgUrl}" />
    </div>
</div>

<div class="H-border-vertical-both-after H-theme-background-color-white">


    <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
        <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">账号：</span>

        <input  readonly="readonly" value="${user.account}" type="text" class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" placeholder="" />
    </div>

    <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
        <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">微信号：</span>
        <input  value="${user.nickName}" name="nickName" id="nickName" type="text" maxlength="20" class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" />
    </div>

    <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
        <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">手机号码：</span>
        <input  value="${user.mobile}" name="mobile" maxlength="20" id="mobile" type="text" class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12"/>
    </div>

    <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
        <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">真实姓名：</span>
        <input  value="${user.cardName}" name="cardName" id="cardName" maxlength="20" type="text" class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" />
    </div>

    <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
        <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">身份证号：</span>
        <input  value="${user.idCard}" name="idCard" id="idCard" maxlength="20" type="text" class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" />
    </div>

    <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
        <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">银行名称：</span>
        <input  value="${user.bankName}" name="bankName" id="bankName" maxlength="20" type="text" class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" />
    </div>

    <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
        <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">银行卡号：</span>
        <input  value="${user.cardNo}" name="cardNo" id="cardNo" maxlength="30" type="text" class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" />
    </div>

    <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
        <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">出生日期：</span>
        <input  value="${user.birthday}" name="birthday" maxlength="20" id="birthday" type="date" class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12"/>
    </div>

    <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
        <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">性&nbsp;&nbsp;&nbsp;&nbsp;别：</span>
        <select name="sex" id="sex" style="width: 120px;" class="H-select-button H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12">
            <option value="1" <c:if test="${user.sex eq '1'}">selected</c:if>>男</option>
            <option value="2" <c:if test="${user.sex eq '2'}">selected</c:if>>女</option>
        </select>
    </div>

    <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
        <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">推荐人：</span>
        <input readonly="readonly" value="${user.tdyj}" type="text" class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" />
    </div>

    <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
        <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">用户类型：</span>
        <span class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" >
             <c:choose>
                 <c:when test="${user.type eq 'Customer'}">普通用户</c:when>
                 <c:when test="${user.type eq 'Gold'}">金牌代理</c:when>
                 <c:when test="${user.type eq 'General' && user.isPartner ne '1'}">全国总代</c:when>
                 <c:when test="${user.type eq 'General' && user.isPartner eq '1'}">
                     <c:choose>
                         <c:when test="${user.userLevel eq '0'}">省级合伙人</c:when>
                         <c:when test="${user.userLevel eq '1'}">副省级合伙人</c:when>
                         <c:when test="${user.userLevel eq '2'}">地市合伙人</c:when>
                         <c:when test="${user.userLevel eq '3'}">区县合伙人</c:when>
                         <c:otherwise>全国总代</c:otherwise>
                     </c:choose>
                 </c:when>
                 <c:otherwise>未知</c:otherwise>
             </c:choose>
            </span>
    </div>
    <c:if test="${user.type ne 'Customer'}">
        <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
            <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">代理时间：</span>
            <input readonly="readonly" value="${user.partnerDateStr}" type="text" class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" />
        </div>
        <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
            <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">代理级别：</span>
            <span class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" placeholder="">
                 <c:if test="${user.type eq 'Gold'}">金牌代理</c:if>
                 <c:if test="${user.type eq 'General' and user.isPartner ne '1'}">全国总代</c:if>
                 <c:if test="${user.type eq 'General' and user.isPartner eq '1'}">
                     <c:choose>
                         <c:when test="${user.userLevel eq '0'}">省级代理</c:when>
                         <c:when test="${user.userLevel eq '1'}">副省级代理</c:when>
                         <c:when test="${user.userLevel eq '2'}">地市级代理</c:when>
                         <c:otherwise>区县级代理</c:otherwise>
                     </c:choose>
                 </c:if>
            </span>
        </div>
        <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
            <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">代理地区：</span>
            <span class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" placeholder="">
              <c:choose>
                  <c:when test="${user.type eq 'Gold'}">${user.userProvinceName}${user.userCityName}${user.userAreaName}</c:when>
                  <c:when test="${user.type eq 'General' and user.isPartner ne '1'}">${user.userProvinceName}${user.userCityName}${user.userAreaName}</c:when>
                  <c:when test="${user.type eq 'General' and user.isPartner eq '1'}">
                      <c:choose>
                          <c:when test="${user.userLevel eq '0'}">${user.userProvinceName}</c:when>
                          <c:when test="${user.userLevel eq '1'}">${user.userProvinceName}${user.userCityName}</c:when>
                          <c:when test="${user.userLevel eq '2'}">${user.userProvinceName}${user.userCityName}</c:when>
                          <c:otherwise>${user.userProvinceName}${user.userCityName}${user.userAreaName}</c:otherwise>
                      </c:choose>
                  </c:when>
              </c:choose>
            </span>
        </div>
    </c:if>

    <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
        <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">当前状态：</span>
        <span class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" placeholder="">
             <c:choose>
                 <c:when test="${user.status eq 'NORMAL'}">正常</c:when>
                 <c:when test="${user.status eq 'FROZEN'}">冻结</c:when>
                 <c:otherwise>未知</c:otherwise>
             </c:choose>
        </span>
    </div>

    <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
        <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-14">加入时间：</span>
        <span class="H-theme-font-color-999 H-textbox H-vertical-align-middle H-vertical-middle H-font-size-14 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" placeholder="">
             ${user.dateStr}
        </span>
    </div>

    <div class="H-padding-10">
        <button  onclick="submit()"  class="H-button H-width-100-percent H-font-size-15 H-outline-none H-padding-vertical-both-12 H-padding-horizontal-both-10 H-theme-background-color4 H-theme-font-color-white H-theme-border-color4 H-theme-border-color4-click H-theme-background-color4-click H-theme-font-color4-click H-border-radius-3">
            修改
        </button>
    </div>
</div>
<script type="text/javascript">
    function submit(){
        var nickName = $("#nickName").val();
        if(nickName==''){
            alert("请输入微信号！");
            return ;
        }
        var mobile = $("#mobile").val();
        if(mobile==''){
            alert("请输入手机号码！");
            return ;
        }
        $.ajax({
           url:"/front/user/updateInfo?r="+Math.random(),
           type:"post",
            data:{
                nickName:nickName,
                birthday:$("#birthday").val(),
                mobile:mobile,
                sex:$("#sex").val(),
                cardName:$("#cardName").val(),
                bankName:$("#bankName").val(),
                idCard:$("#idCard").val(),
                cardNo:$("#cardNo").val()
            },
            success:function(res){
                alert(res.msg);
                if(res.success){
                    window.location.href = "/front/user/main";
                }
            },
            error:function(){}
        });

    }
</script>
</body>
</html>